package com.thd.springboottest.mybatisplus.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.thd.springboottest.mybatisplus.entity.SysUser;
import com.thd.springboottest.mybatisplus.vo.SysUserVo;

import java.util.List;

/**
 * com.thd.springboottest.mybatisplus.service.SysUserService
 *
 * @author: wanglei62
 * @DATE: 2019/9/20 16:13
 **/

public interface SysUserService extends IService<SysUser> {
    /**
     * 查询所有
     * @return
     */
    public List queryAll();

    /**
     * LambdaQueryWrapper的使用
     * @param userName
     * @return
     */
    public SysUser loadByName(String userName);
    public List<SysUser> queryByName(String userName);
    /**
     * 根据条件查询
     * @param wrapper
     * @return
     */
    public List queryByCondition(QueryWrapper<SysUser> wrapper);

    public SysUser queryById(String id);

    public List queryByPage(QueryWrapper<SysUser> wrapper,int currentPage,int pageSize);

    // 调用mapper.xml中SQL的方法
    public List<SysUser> queryList(SysUser sysUser);

    // wrapper结合xml
    public List<SysUser> testQueryWrapperAndXml();


    public List<SysUser> testSqlSegment(QueryWrapper<SysUser> qw);

    /**
     * myBatisPlus 分页连接查询测试
     * @param page 分页参数
     * @param sysUserVo 查询条件
     * @return
     */
    public IPage<SysUserVo> pageJoinQuery(IPage<SysUserVo> page, SysUserVo sysUserVo);
}
